package com.bt.dmdb.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "ODS_PROP_SITE")
@SuppressWarnings("serial")
public class PropSite implements java.io.Serializable {

    private long id;
    private Site site;
    private Prop prop;
    private Project project;
    private ProjectSite projectSite;
    private Set<PropSiteMilestone> propSiteMilestones = new HashSet<PropSiteMilestone>(0);

    public PropSite() {
    }

    public PropSite(long id) {
        this.id = id;
    }

    public PropSite(long id, Site site, Prop prop, Project project, ProjectSite projectSite, Set<PropSiteMilestone> propSiteMilestones) {
        this.id = id;
        this.site = site;
        this.prop = prop;
        this.project = project;
        this.projectSite = projectSite;
        this.propSiteMilestones = propSiteMilestones;
    }

    @Id
    @Column(name = "ID", unique = true, nullable = false, precision = 10, scale = 0)
    public long getId() {
        return this.id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SITE_ID")
    public Site getSite() {
        return this.site;
    }

    public void setSite(Site site) {
        this.site = site;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PROP_ID")
    public Prop getProp() {
        return this.prop;
    }

    public void setProp(Prop prop) {
        this.prop = prop;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PROJECT_ID")
    public Project getProject() {
        return this.project;
    }

    public void setProject(Project project) {
        this.project = project;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PROJECT_SITE_ID")
    public ProjectSite getProjectSite() {
        return this.projectSite;
    }

    public void setProjectSite(ProjectSite projectSite) {
        this.projectSite = projectSite;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "propSite")
    public Set<PropSiteMilestone> getPropSiteMilestones() {
        return this.propSiteMilestones;
    }

    public void setPropSiteMilestones(Set<PropSiteMilestone> propSiteMilestones) {
        this.propSiteMilestones = propSiteMilestones;
    }
}
